<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    
    <h:head>
        <title>Add a User</title>
    </h:head>
    <h:body>
        <f:view>
            <h:form>
                <br/>
                <h:panelGrid border="1" columns="2">
                    <f:facet name="header">
                        <h:outputText value="Enter your information"/>
                    </f:facet>
                    <h:outputText value="Username"/>
                    <h:inputText value="#{user.username}"/>
                    <h:outputText value="Password"/>
                    <h:inputText value="#{user.password}"/>
                    <h:outputText value="Permission Level"/>
                    <h:selectOneMenu id ="typeHolder" value="#{user.permissionLevelID}">
                        <c:forEach var="permission" items="#{permission.permissions}">
                            <f:selectItem itemValue="#{permission.id}" itemLabel="#{permission.permissionLevel}"/>
                        </c:forEach>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br/>
                <h:commandButton value="Access" action="#{user.addUser}"/>
            </h:form>
        </f:view>
    </h:body>
</html>

